package com.gec;

import java.util.Random;

public class CaptchaGenerator {

    public static void main(String[] args) {
        int length = 4;
        System.out.println(generateCaptcha(length));
    }

    public static String generateCaptcha(int length) {
        String captcha = "";
        Random random = new Random();
        for (int i = 0; i < length; i++) {
            int randomNumber = random.nextInt(10);
            captcha += randomNumber;
        }
        return captcha;
    }
}
